/* Copyright (C) 2012  Chris Mueller <ruunsmail@googlemail.com>
 *
 * This file is part of the Liquid Programming Language
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef LIQUID__SYMBOL_H
#define LIQUID__SYMBOL_H

#include "base.h"

struct LqContext;

enum LqSymbolKind {
    LQ_SYMBOL_VALUE,
    LQ_SYMBOL_NAMESPACE
};


struct LqSymbol {
    enum LqSymbolKind kind;
    int line;
    struct LqNode* node;
};


struct LqSymbol*   lq_symbol_value_new(int line, struct LqNode* node);
struct LqSymbol*   lq_symbol_namespace_new(int line, struct LqNode* node);

struct LqSymbol*   lq_symboltable_get(struct LqContext* context, 
                                      const byte* identifier);

int                lq_symboltable_add(struct LqContext* context, 
                                      const byte* identifier, 
                                      struct LqSymbol* symbol);


#endif // LIQUID__SYMBOL_H
